/*
*  Copyright 2019-2020 Zheng Jie
*
*  Licensed under the Apache License, Version 2.0 (the "License");
*  you may not use this file except in compliance with the License.
*  You may obtain a copy of the License at
*
*  http://www.apache.org/licenses/LICENSE-2.0
*
*  Unless required by applicable law or agreed to in writing, software
*  distributed under the License is distributed on an "AS IS" BASIS,
*  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*  See the License for the specific language governing permissions and
*  limitations under the License.
*/
package me.zhengjie.modules.cspimp.pcm.domain;

import lombok.Data;
import cn.hutool.core.bean.BeanUtil;
import io.swagger.annotations.ApiModelProperty;
import cn.hutool.core.bean.copier.CopyOptions;
import javax.persistence.*;
import javax.validation.constraints.*;
import java.sql.Timestamp;
import java.io.Serializable;

/**
* @website https://docs.auauz.net
* @description /
* @author zmm
* @date 2020-06-27
**/
@Entity
@Data
@Table(name="pcp_equip_check")
public class EquipCheck implements Serializable {

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "id")
    @ApiModelProperty(value = "id")
    private Long id;

    @Column(name = "create_time",nullable = false)
    @NotNull
    @ApiModelProperty(value = "创建时间")
    private Timestamp createTime;

    @Column(name = "update_time",nullable = false)
    @NotNull
    @ApiModelProperty(value = "更新时间")
    private Timestamp updateTime;

    @Column(name = "create_by")
    @ApiModelProperty(value = "创建者")
    private String createBy;

    @Column(name = "update_by")
    @ApiModelProperty(value = "更新者")
    private String updateBy;

    @Column(name = "name")
    @ApiModelProperty(value = "name")
    private String name;

    @Column(name = "cid")
    @ApiModelProperty(value = "所属公司")
    private Long cid;

    @Column(name = "pid")
    @ApiModelProperty(value = "所属项目")
    private Long pid;

    @Column(name = "alarm_status_code")
    @ApiModelProperty(value = "报警状态code")
    private String alarmStatusCode;

    @Column(name = "alarm_status_name")
    @ApiModelProperty(value = "报警状态名称")
    private String alarmStatusName;

    @Column(name = "alarm_time")
    @ApiModelProperty(value = "报警时间")
    private String alarmTime;

    @Column(name = "equip_name")
    @ApiModelProperty(value = "设备名称")
    private String equipName;

    @Column(name = "alarm_level_code")
    @ApiModelProperty(value = "报警等级code")
    private String alarmLevelCode;

    @Column(name = "alarm_level_id")
    @ApiModelProperty(value = "报警等级id")
    private String alarmLevelId;

    @Column(name = "alarm_level_name")
    @ApiModelProperty(value = "报警等级名称")
    private String alarmLevelName;

    @Column(name = "alarm_mess")
    @ApiModelProperty(value = "报警信息")
    private String alarmMess;

    @Column(name = "deal_time")
    @ApiModelProperty(value = "处理时间")
    private String dealTime;

    @Column(name = "deal_mess")
    @ApiModelProperty(value = "处理信息")
    private String dealMess;

    public void copy(EquipCheck source){
        BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
    }
}